package cn.cmft.jc.config;

import org.apache.flink.api.java.utils.ParameterTool;

import java.io.IOException;
import java.io.InputStream;

public class FlinkConfigReader {

    private static final ParameterTool parameterTool;

    private FlinkConfigReader(){}

    static {
        InputStream cfgStream = FlinkConfigReader
                .class.getClassLoader()
                .getResourceAsStream("application.properties");
        try {
            parameterTool = ParameterTool.fromPropertiesFile(cfgStream);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public static ParameterTool getParameterTool() {
        return parameterTool;
    }
}
